//
//  StressStateCell.swift
//  DaRings
//
//  Created by 尹琼 on 2022/11/3.
//

import UIKit
import MYModule

class StressStateCell: TableViewCell {
    
    let stressLabel = Label()
    
    let dateLabel = Label()
    
    let stateView = StressStateView()
    
    
    override func makeUI() {
        super.makeUI()
        
        contentView.backgroundColor =  UIColor.darkBackground
        
        let topView = UIView()
        topView.backgroundColor = UIColor.background
        
        let bgView = View()
        bgView.backgroundColor = UIColor.background
        bgView.cornerRadius = 18.0
        
        stressLabel.font = Fonts.boldSystemFont(ofSize: 44.0)
        stressLabel.textColor = UIColor.assist_222222
        
        dateLabel.font = Fonts.systemFont(ofSize: 12)
        dateLabel.textColor = UIColor.assist_222222
        
        contentView.addSubview(topView)
        contentView.addSubview(bgView)
    
        bgView.addSubview(stressLabel)
        bgView.addSubview(dateLabel)
        bgView.addSubview(stateView)
        
        topView.snp.makeConstraints { make in
            make.left.top.right.equalToSuperview()
            make.height.equalTo(36)
        }
        
        bgView.snp.makeConstraints { make in
            make.top.left.right.equalToSuperview()
            make.bottom.equalTo(-20)
        }
        
        stressLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(30)
        }
        
        dateLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(stressLabel.snp.bottom).offset(7)
        }
        
        stateView.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(20)
            make.right.equalToSuperview().offset(-20)
            make.top.equalTo(dateLabel.snp.bottom).offset(36)
            make.bottom.equalToSuperview().offset(-30)
        }
        
    }
    
    
    
    
}
